package n17.second;

import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;

public class S01 {

	public static void main(String[] args) throws FileNotFoundException, UnsupportedEncodingException {
		String s="Constant dripping wears away the stone.\r\n锲而不舍，金石可镂。";
		System.out.println(s); //输出信息到屏幕
		PrintStream ps=new PrintStream("D:/out/名言.txt", "utf-8"); //创建utf-8格式文件输出流
		PrintStream out=System.out; //保存原来的标准输出流
		System.setOut(ps); //设置新的输出流
		System.out.println(s); //输出信息到文件
		System.setOut(out); //恢复原来的标准输出流
		System.out.println("Over"); //在屏幕上显示Over


	}

}
